package com.google.code.irouter.portal.client.dashboard.main.center.managers.queue.browser.command;

import com.google.code.irouter.portal.client.AppConstants;
import com.google.code.irouter.portal.client.dashboard.main.center.managers.queue.Browser;
import com.google.gwt.core.client.GWT;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.core.Ext;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.MessageBox;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;

public final class RemoveListener extends ButtonListenerAdapter {
	
	private static final AppConstants CONSTANTS = GWT.create(AppConstants.class);
	
	@Override
	public void onClick(Button button, EventObject e) {
		MessageBox.confirm(
				CONSTANTS.com_google_code_irouter_portal_client_common_confirm(), 
				CONSTANTS.com_google_code_irouter_portal_client_common_confirm_remove(),  
                new MessageBox.ConfirmCallback() {  
                    public void execute(String btnID) {
                    	if(btnID.equals("yes"))
                    		((Browser) Ext.getCmp(Browser.class.getName())).remove();
                    }
                }
		);
	}
}
